Skip to content

Show pdf in yml-enabled setup if this format enabled #2638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Show pdf in yml-enabled setup if this format enabled #2638

wants to merge 2 commits into from

Conversation

skirpichev
Copy link
Contributor

This is a very early attempt to fix #2582.

It looks also, that documented yml syntax for "format" option was changed. This fix was tested in this repo and it doesn't work with .readthedocs.yml in my master branch, but it does if I change format configuration to:

formats:
    htmlzip: true
    pdf: true

(See yml file on another branch.)

Is the old syntax supported, or the docs should be adapted to reflect new syntax, documented in spec.rst?

    def load_yaml_config(version):
...
>       checkout_path = version.project.checkout_path(version.slug)
E       AttributeError: 'NoneType' object has no attribute 'project'

in test_has_pdf and test_has_pdf_with_pdf_build_disabled
of the test_project.py.
@@ -570,8 +572,15 @@ def has_aliases(self):
return self.aliases.exists()

def has_pdf(self, version_slug=LATEST):
version = self.versions.filter(slug=version_slug).first()
if not self.enable_pdf_build:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably just remove the initial check on this, and simply look for the file existing. I believe the issue is that we'd have PDF's sitting on disk that were stale, so we added this flag. Another option is to set this flag in the database based off the YAML file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericholscher, are you about this check, on L573? I think, I have tried this, that breaks tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, the tests would need to be changed, as it would be a change in how things work. Perhaps the easiest update would be to actually update the database for a project from the YAML file on build. I'd want @agjohnson's thoughts on that though, because it is a weird UX. Perhaps if we detect YAML we can hide the fields on the web UI, and update them from the YAML for consistency.

@ericholscher ericholscher added Needed: patch A pull request is required and removed PR: ready for review labels Mar 3, 2017
@skirpichev
Copy link
Contributor Author

skirpichev commented Mar 4, 2017

@ericholscher, thank you for review and sorry for your time. I'll close this pr per #2362.

@skirpichev skirpichev closed this Mar 4, 2017
@skirpichev skirpichev deleted the show-pdf branch March 4, 2017 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: patch A pull request is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pdf output wasn't shown in yaml-enabled setup
3 participants